From: Stefan Monnier Date: Fri, 16 Apr 2004 21:52:14 +0000 (+0000) Subject: (diff-end-of-hunk): Be more careful with unified hunks. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~23148 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=d1649f185a7ba45af09c3534c0a79938a9a2e611;p=emacs.git (diff-end-of-hunk): Be more careful with unified hunks. --- diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index f6b2520a112..d41bfcad58a 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el @@ -305,7 +305,11 @@ when editing big diffs)." (defvar diff-narrowed-to nil) (defun diff-end-of-hunk (&optional style) - (if (looking-at diff-hunk-header-re) (goto-char (match-end 0))) + (when (looking-at diff-hunk-header-re) + (unless style + ;; Especially important for unified (because headers are ambiguous). + (setq style (cdr (assq (char-after) '((?@ . unified) (?* . context)))))) + (goto-char (match-end 0))) (let ((end (and (re-search-forward (case style ;; A `unified' header is ambiguous. (unified (concat "^[^-+# \\]\\|"